package testSpring;

import com.service.Greeting;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 上机1
 */
public class test4 {

    @Test
    public void print(){
        ApplicationContext context=new ClassPathXmlApplicationContext("applicationContext.xml");
        Greeting zhangGa= (Greeting) context.getBean("zhangGa");
        Greeting rod= (Greeting) context.getBean("rod");
        zhangGa.sayGreeting();
        rod.sayGreeting();
    }
}
